package com.kuangstudy.oop.demo2;

import com.kuangstudy.oop.demo1.Person;

/**
 * ClassName: Student
 * date: 2021/07/11 22:15:06
 *
 * @author zlk
 */
public class Student extends Person {
    public Student() {
        /*默认调用了父类的无参构造*/
        super();//调用父类构造器必须在第一行
        System.out.println("student 无参构造器");
    }

    String name = "student";
    public void print(){
        System.out.println("student");
    }
    public void test2(){
        print();
        this.print();
        super.print();
    }
    public void test(String name){
        System.out.println(name);
        System.out.println(this.name);
        System.out.println(super.name);
    }
}
